<!doctype html>
<html>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width initial-scale=1'>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link rel="stylesheet" href="markdown.css?v=1641871594082"/>
    <title>反向代理(server)接口</title>
</head>
<body>
<div class="markdown-body">
    <h1>反向代理(server)接口</h1>
<h2>获取server分页列表</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/getPage</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 获取server分页列表</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>current</td><td>int32</td><td>当前页数(从1开始)</td><td>true</td><td>-</td></tr>
<tr><td>limit</td><td>int32</td><td>每页数量(默认为10)</td><td>true</td><td>-</td></tr>
<tr><td>keywords</td><td>string</td><td>查询关键字</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/getPage?current=am28jh&amp;limit=10&amp;keywords=gmci3u
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
<tr><td>└─count</td><td>int64</td><td>总记录数</td><td>-</td></tr>
<tr><td>└─curr</td><td>int32</td><td>起始页(从1开始)</td><td>-</td></tr>
<tr><td>└─limit</td><td>int32</td><td>每页记录数</td><td>-</td></tr>
<tr><td>└─records</td><td>array</td><td>列表内容</td><td>-</td></tr>
<tr><td>     └─id</td><td>string</td><td>主键</td><td>-</td></tr>
<tr><td>     └─serverName</td><td>string</td><td>监听域名</td><td>-</td></tr>
<tr><td>     └─listen</td><td>string</td><td>监听ip端口 (格式 ip:port或port)</td><td>-</td></tr>
<tr><td>     └─def</td><td>int32</td><td>是否为默认server 0否(默认) 1是</td><td>-</td></tr>
<tr><td>     └─rewrite</td><td>int32</td><td>是否http跳转https 0否(默认) 1是</td><td>-</td></tr>
<tr><td>     └─rewriteListen</td><td>string</td><td>http跳转https监听ip端口,默认为80 (格式 ip:port或port)</td><td>-</td></tr>
<tr><td>     └─ssl</td><td>int32</td><td>是否开启ssl 0否(默认) 1是</td><td>-</td></tr>
<tr><td>     └─http2</td><td>int32</td><td>是否开启http2 0否(默认) 1是</td><td>-</td></tr>
<tr><td>     └─proxyProtocol</td><td>int32</td><td>是否开启proxy_protocol 0否(默认) 1是</td><td>-</td></tr>
<tr><td>     └─pem</td><td>string</td><td>ssl证书pem文件路径</td><td>-</td></tr>
<tr><td>     └─key</td><td>string</td><td>ssl证书key文件路径</td><td>-</td></tr>
<tr><td>     └─proxyType</td><td>int32</td><td>代理类型 0:http(默认) 1:tcp 2:udp</td><td>-</td></tr>
<tr><td>     └─proxyUpstreamId</td><td>string</td><td>代理upstream的id</td><td>-</td></tr>
<tr><td>     └─enable</td><td>boolean</td><td>是否启用 true:启用(默认) false:禁用</td><td>-</td></tr>
<tr><td>     └─descr</td><td>string</td><td>描述</td><td>-</td></tr>
<tr><td>     └─protocols</td><td>string</td><td>加密协议 (默认:TLSv1 TLSv1.1 TLSv1.2 TLSv1.3)</td><td>-</td></tr>
<tr><td>     └─passwordId</td><td>string</td><td>使用的password文件Id</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;5apfo5&quot;,
	&quot;msg&quot;:&quot;yt3ai7&quot;,
	&quot;obj&quot;:{
		&quot;count&quot;:986,
		&quot;curr&quot;:530,
		&quot;limit&quot;:10,
		&quot;records&quot;:[
			{
				&quot;id&quot;:&quot;45&quot;,
				&quot;serverName&quot;:&quot;鹤轩.白&quot;,
				&quot;listen&quot;:&quot;0prb73&quot;,
				&quot;def&quot;:168,
				&quot;rewrite&quot;:182,
				&quot;rewriteListen&quot;:&quot;6ggh7u&quot;,
				&quot;ssl&quot;:735,
				&quot;http2&quot;:539,
				&quot;proxyProtocol&quot;:159,
				&quot;pem&quot;:&quot;inoiaq&quot;,
				&quot;key&quot;:&quot;c44lt0&quot;,
				&quot;proxyType&quot;:323,
				&quot;proxyUpstreamId&quot;:&quot;45&quot;,
				&quot;enable&quot;:true,
				&quot;descr&quot;:&quot;vvpe1q&quot;,
				&quot;protocols&quot;:&quot;zq3ak2&quot;,
				&quot;passwordId&quot;:&quot;45&quot;
			}
		]
	}
}
</code></pre>
<h2>添加或编辑server</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/insertOrUpdate</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 添加或编辑server</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>主键</td><td>false</td><td>-</td></tr>
<tr><td>serverName</td><td>string</td><td>监听域名</td><td>false</td><td>-</td></tr>
<tr><td>listen</td><td>string</td><td>监听ip端口 (格式 ip:port或port)</td><td>true</td><td>-</td></tr>
<tr><td>def</td><td>int32</td><td>是否为默认server 0否(默认) 1是</td><td>false</td><td>-</td></tr>
<tr><td>rewrite</td><td>int32</td><td>是否http跳转https 0否(默认) 1是</td><td>false</td><td>-</td></tr>
<tr><td>rewriteListen</td><td>string</td><td>http跳转https监听ip端口,默认为80 (格式 ip:port或port)</td><td>false</td><td>-</td></tr>
<tr><td>ssl</td><td>int32</td><td>是否开启ssl 0否(默认) 1是</td><td>false</td><td>-</td></tr>
<tr><td>http2</td><td>int32</td><td>是否开启http2 0否(默认) 1是</td><td>false</td><td>-</td></tr>
<tr><td>proxyProtocol</td><td>int32</td><td>是否开启proxy_protocol 0否(默认) 1是</td><td>false</td><td>-</td></tr>
<tr><td>pem</td><td>string</td><td>ssl证书pem文件路径</td><td>false</td><td>-</td></tr>
<tr><td>key</td><td>string</td><td>ssl证书key文件路径</td><td>false</td><td>-</td></tr>
<tr><td>proxyType</td><td>int32</td><td>代理类型 0:http(默认) 1:tcp 2:udp</td><td>false</td><td>-</td></tr>
<tr><td>proxyUpstreamId</td><td>string</td><td>代理upstream的id</td><td>false</td><td>-</td></tr>
<tr><td>enable</td><td>boolean</td><td>是否启用 true:启用(默认) false:禁用</td><td>false</td><td>-</td></tr>
<tr><td>descr</td><td>string</td><td>描述</td><td>false</td><td>-</td></tr>
<tr><td>protocols</td><td>string</td><td>加密协议 (默认:TLSv1 TLSv1.1 TLSv1.2 TLSv1.3)</td><td>false</td><td>-</td></tr>
<tr><td>passwordId</td><td>string</td><td>使用的password文件Id</td><td>false</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/insertOrUpdate?rewriteListen=3r7p63&amp;key=w4l1bh&amp;listen=09xusm&amp;protocols=ulhmpa&amp;proxyProtocol=948&amp;seq=0&amp;pem=qm42n3&amp;descr=n6q0ov&amp;updateTime=1641871596310&amp;serverName=鹤轩.白&amp;proxyType=303&amp;pemStr=btwgd2&amp;def=448&amp;enable=true&amp;proxyUpstreamId=45&amp;id=45&amp;passwordId=45&amp;ssl=812&amp;keyStr=c9535u&amp;http2=928&amp;createTime=1641871596310&amp;rewrite=128
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;ibmlr3&quot;,
	&quot;msg&quot;:&quot;ml9q3z&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>
<h2>删除server</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/delete</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 删除server</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>反向代理id</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/delete?id=45
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;iqy47a&quot;,
	&quot;msg&quot;:&quot;azv4p7&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>
<h2>根据serverId获取location列表</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/getLocationByServerId</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 根据serverId获取location列表</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>serverId</td><td>string</td><td>反向代理id</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/getLocationByServerId?serverId=45
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
<tr><td>└─id</td><td>string</td><td>主键</td><td>-</td></tr>
<tr><td>└─serverId</td><td>string</td><td>所属反向代理serverId</td><td>-</td></tr>
<tr><td>└─path</td><td>string</td><td>监控路径 例:/</td><td>-</td></tr>
<tr><td>└─type</td><td>int32</td><td>代理类型 0:动态代理(默认) 1:静态代理 2:负载均衡 3:空白代理</td><td>-</td></tr>
<tr><td>└─value</td><td>string</td><td>动态代理目标 (例:http://10.10.10.1:8080/)</td><td>-</td></tr>
<tr><td>└─upstreamType</td><td>string</td><td>代理负载协议,http or https</td><td>-</td></tr>
<tr><td>└─upstreamId</td><td>string</td><td>代理负载均衡upstream的id</td><td>-</td></tr>
<tr><td>└─upstreamPath</td><td>string</td><td>代理负载额外路径,默认为空</td><td>-</td></tr>
<tr><td>└─rootPath</td><td>string</td><td>静态代理路径 (例:/home/www)</td><td>-</td></tr>
<tr><td>└─rootPage</td><td>string</td><td>静态代理默认页面 (例:index.html)</td><td>-</td></tr>
<tr><td>└─rootType</td><td>string</td><td>静态代理类型 root:根路径模式 alias:别名模式</td><td>-</td></tr>
<tr><td>└─header</td><td>int32</td><td>是否携带Host参数 0否 1是(默认)</td><td>-</td></tr>
<tr><td>└─websocket</td><td>int32</td><td>是否开启websocket支持 0否(默认) 1是</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;kilgm4&quot;,
	&quot;msg&quot;:&quot;um1ium&quot;,
	&quot;obj&quot;:[
		{
			&quot;id&quot;:&quot;45&quot;,
			&quot;serverId&quot;:&quot;45&quot;,
			&quot;path&quot;:&quot;q6c9bl&quot;,
			&quot;type&quot;:828,
			&quot;value&quot;:&quot;suqxyi&quot;,
			&quot;upstreamType&quot;:&quot;d3i9xl&quot;,
			&quot;upstreamId&quot;:&quot;45&quot;,
			&quot;upstreamPath&quot;:&quot;l45vw3&quot;,
			&quot;rootPath&quot;:&quot;2hjcec&quot;,
			&quot;rootPage&quot;:&quot;ws27nb&quot;,
			&quot;rootType&quot;:&quot;5ccy8i&quot;,
			&quot;header&quot;:241,
			&quot;websocket&quot;:252
		}
	]
}
</code></pre>
<h2>添加或编辑location</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/insertOrUpdateLocation</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 添加或编辑location</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>主键</td><td>false</td><td>-</td></tr>
<tr><td>serverId</td><td>string</td><td>所属反向代理serverId</td><td>true</td><td>-</td></tr>
<tr><td>path</td><td>string</td><td>监控路径 例:/</td><td>true</td><td>-</td></tr>
<tr><td>type</td><td>int32</td><td>代理类型 0:动态代理(默认) 1:静态代理 2:负载均衡 3:空白代理</td><td>false</td><td>-</td></tr>
<tr><td>value</td><td>string</td><td>动态代理目标 (例:http://10.10.10.1:8080/)</td><td>false</td><td>-</td></tr>
<tr><td>upstreamType</td><td>string</td><td>代理负载协议,http or https</td><td>false</td><td>-</td></tr>
<tr><td>upstreamId</td><td>string</td><td>代理负载均衡upstream的id</td><td>false</td><td>-</td></tr>
<tr><td>upstreamPath</td><td>string</td><td>代理负载额外路径,默认为空</td><td>false</td><td>-</td></tr>
<tr><td>rootPath</td><td>string</td><td>静态代理路径 (例:/home/www)</td><td>false</td><td>-</td></tr>
<tr><td>rootPage</td><td>string</td><td>静态代理默认页面 (例:index.html)</td><td>false</td><td>-</td></tr>
<tr><td>rootType</td><td>string</td><td>静态代理类型 root:根路径模式 alias:别名模式</td><td>false</td><td>-</td></tr>
<tr><td>header</td><td>int32</td><td>是否携带Host参数 0否 1是(默认)</td><td>false</td><td>-</td></tr>
<tr><td>websocket</td><td>int32</td><td>是否开启websocket支持 0否(默认) 1是</td><td>false</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/insertOrUpdateLocation?createTime=1641871596310&amp;locationParamJson=30rgac&amp;upstreamType=lebfju&amp;updateTime=1641871596310&amp;path=mgt8hc&amp;type=21&amp;rootPage=6mixs1&amp;header=807&amp;value=llfa10&amp;upstreamId=45&amp;rootType=46asvm&amp;rootPath=mdejkj&amp;websocket=224&amp;id=45&amp;serverId=45&amp;upstreamPath=mqqzqf
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;tw4lux&quot;,
	&quot;msg&quot;:&quot;77ywvi&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>
<h2>删除location</h2>
<p><strong>URL:</strong> <code>http://your_ip:port/api/server/deleteLocation</code></p>
<p><strong>Type:</strong> <code>ANY</code></p>
<p><strong>Content-Type:</strong> <code>application/x-www-form-urlencoded;charset=utf-8</code></p>
<p><strong>Description:</strong> 删除location</p>
<p><strong>Request-parameters:</strong></p>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th><th>Required</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>id</td><td>string</td><td>代理目标location的id</td><td>true</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Request-example:</strong></p>
<pre><code>curl   -i http://your_ip:port/api/server/deleteLocation?id=45
</code></pre>
<p><strong>Response-fields:</strong></p>
<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Since</th></tr>
</thead>
<tbody>
<tr><td>success</td><td>boolean</td><td>请求结果</td><td>-</td></tr>
<tr><td>status</td><td>string</td><td>请求状态 200:请求成功 401:token无效 500:服务器错误</td><td>-</td></tr>
<tr><td>msg</td><td>string</td><td>错误信息</td><td>-</td></tr>
<tr><td>obj</td><td>object</td><td>返回内容</td><td>-</td></tr>
</tbody>
</table>
<p><strong>Response-example:</strong></p>
<pre><code>{
	&quot;success&quot;:true,
	&quot;status&quot;:&quot;z7plds&quot;,
	&quot;msg&quot;:&quot;rgom7n&quot;,
	&quot;obj&quot;:{
		
	}
}
</code></pre>

    <footer class="page-footer">
        <span class="copyright">Generated by smart-doc at 2022-01-11 11:26:34</span>
        <span class="footer-modification">Suggestions, contact, support and error reporting on
            <a href="https://gitee.com/smart-doc-team/smart-doc" target="_blank">Gitee</a> or
            <a href="https://github.com/smart-doc-group/smart-doc" target="_blank">Github</a>
        </span>
    </footer>
</div>
</body>
</html>